package com.coolingme.mouseevent.handler;

import com.coolingme.mouseevent.core.EventContext;

/**
 * 具体的被观察者
 *
 * @author wangyue
 * @date 2020-10-19 23:15
 */
public class Mouse extends EventContext {

    public void click() {
        System.out.println("调用单击方法");
        // 通知观察者触发事件
        this.trigger(MouseEventType.ON_CLICK);
    }

    public void doubleClick() {
        System.out.println("调用双击方法");
        this.trigger(MouseEventType.ON_DOUBLE_CLICK);
    }

    public void move() {
        System.out.println("调用移动方法");
        this.trigger(MouseEventType.ON_MOVE);
    }

}
